package com.alpha.eceasy.mall.service.impl;

import com.alpha.eceasy.extension.BaseFormInfo;
import com.alpha.eceasy.mall.api.entity.MallImDetail;
import com.alpha.eceasy.mall.mapper.MallImDetailMapper;
import com.alpha.eceasy.mall.service.MallImDetailService;
import com.alpha.eceasy.extension.BaseServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 聊天会话详情表 服务实现类
 * </p>
 *
 * @author huangpengfei
 * @since 2024-05-15
 */
@Service
public class MallImDetailServiceImpl extends BaseServiceImpl<MallImDetailMapper, MallImDetail> implements MallImDetailService {

    public List<MallImDetail> listByImGuid(String imGuid) {
        return this.list(Wrappers.<MallImDetail>lambdaQuery()
                .eq(MallImDetail::getMallImGuid, imGuid)
                .orderByDesc(BaseFormInfo::getCreateTime));
    }
}
